package com.exce.enums;

/**
 * @author yinxing
 * @date 2022-09-09
 */
public enum ErrorEnum {
    // 数据操作错误定义
    SUCCESS(200, "成功"),
    CONTROLLER(200, "Controller"),
    SERVICE(200, "Service"),
    MAPPER(200, "Mapper"),
    NO_PERMISSION(403,"你没得权限"),
    NO_AUTH(401,"未登录"),
    SELF_EXCEPTION(401,"手动异常"),
    SYSTEM_EXCEPTION(401,"系统异常"),
    NOT_FOUND(404, "未找到该资源!"),
    INTERNAL_SERVER_ERROR(501, "全局自定义异常"),
    ;

    /** 错误码 */
    private Integer errorCode;

    /** 错误信息 */
    private String errorMsg;

    ErrorEnum(Integer errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
}
